hysop.core.memory.memory_request module

class hysop.core.memory.memory_request.MemoryRequest(backend, size=None, shape=None, dtype=None, alignment=None, nb_components=1)[source]

Bases: object

Memory request that can be requested in get_work_properties()

Creates a memory request to be served from given backend.

When dtype is not specified, size represents the number of bytes else the number of elements of given data type.

size can be specified directly by a n-dimensional shape parameter. In this case, depending on the chosen backend, the output buffer may be altered to accomodate this shape (like numpy n-dimensional arrays).

Every np.bool request is converted to HYSOP_BOOL dtype (ie. some integer type).

__call__(op=None, request_identifier=None)[source]

Promote this MemoryRequest object to a MultipleOperatorMemoryRequests object.

alignment
backend
bytes_per_element(dtype)[source]

Returns the size in bytes of the allocated data type.

classmethod cartesian_dfield_like(name, dfield, nb_components=None, initial_values=None, dtype=None, grid_resolution=None, ghosts=None, backend=None, is_read_only=None)[source]
data_bytes_per_component()[source]

Bytes to be allocated per components.

dtype
classmethod empty_like(a, backend=None, alignment=None, dtype=None, size=None, shape=None, nb_components=None)[source]
id
max_alloc_size(backend)[source]

Returns the maximal alloc size supported by backend.

max_bytes()[source]

Real number bytes that will be allocated for all components.

max_bytes_per_component()[source]

Real number bytes that will be allocated for all components.

min_bytes()[source]

Minimum number bytes that may be allocated for all components.

min_dtype_alignment(dtype)[source]

Returns the minimum alignement of the allocated buffer (in bytes).

min_hardware_alignment(backend)[source]

Returns the minimum alignement to be hardware aligned (in bytes).

nb_components
shape
size
stuple()[source]
class hysop.core.memory.memory_request.MultipleOperatorMemoryRequests[source]

Bases: object

Set of memory requests originating from one or more operators.

allocate(allow_subbuffers)[source]

Handle memory request issued by operators.

get_buffer(operator, request_identifier, handle=False)[source]
min_bytes_to_allocate(backend)[source]
operators()[source]
push_mem_requests(*requests)[source]
sreport()[source]
class hysop.core.memory.memory_request.OperatorMemoryRequests(operator)[source]

Bases: object

Set of memory requests originating from one operator, sorted by backend.

__call__()[source]

Promote this OperatorMemoryRequests object to a MultipleOperatorMemoryRequests object.

min_bytes_to_allocate(backend)[source]
push_mem_request(request_identifier, mem_request)[source]